package qnit.test.hibiernate;


import org.hibernate.Session;

import com.foeye.bean.Author;
import com.foeye.bean.Biography;
import com.foeye.bean.HibernateSessionFactory;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main(String[] args) {  
    	  
        Session session = HibernateSessionFactory.getSession();  
        session.beginTransaction();  
          
        Author author = new Author();  
        author.setName(" O. Henry");  
          
        Biography biography = new Biography();  
        biography.setInformation("William Sydney Porter  better known as O. Henry...");  
          
        author.setBiography(biography);  
        biography.setAuthor(author);  
          
        session.save(author);  
          
        session.getTransaction().commit();  
          
        session.close();  
  
    }
}
